# -- coding: utf-8 --
from tools.Request_General import BaseAPI


class ListTable(BaseAPI):
    """
    清单表相关接口
    """

    def rear_notice_elementCopy(self, payload):
        """
        清单表元素复制后置通知
        """
        r = self.request_send(json=payload)
        return r

    def rear_notice_elementImport(self, payload):
        """
        清单表元素复制后置通知
        """
        r = self.request_send(json=payload)
        return r

    def save_list_table(self, payload):
        """
        清单表保存
        """
        r = self.request_send(json=payload)
        return r

    def get_global_button(self, payload):
        """
        获取全局按钮
        """
        r = self.request_send(json=payload)
        return r

    def get_line_button(self, payload):
        """
        获取行按钮
        """
        r = self.request_send(json=payload)
        return r

    def get_list_table_view(self, payload):
        """
        清单表编辑视图获取
        """
        r = self.request_send(params=payload)
        return r

    def list_table_data(self, payload):
        """
        清单表使用视图获取数据
        """
        r = self.request_send(json=payload)
        return r

    def list_table_data_export(self, payload):
        """
        清单表数据导出接口
        """
        r = self.request_send(json=payload)
        return r

    def list_table_js(self, payload):
        """
        清单表自定义js获取
        """
        r = self.request_send(params=payload)
        return r

    def list_table_js_save(self, payload):
        """
        清单表自定义JS保存
        """
        r = self.request_send(json=payload)
        return r

    def app_create_callback(self, payload):
        """
        新建应用回调
        """
        r = self.request_send(json=payload)
        return r

    def list_table_language(self, payload):
        """
        修复清单表多语言数据接口
        """
        r = self.request_send(json=payload)
        return r

    def list_table_data_delete(self, payload):
        """
        清单表关联业务数据模型的数据删除接口
        """
        r = self.request_send(json=payload)
        return r

    def list_table_js_repair(self, payload):
        """
        修复清单表js数据
        """
        r = self.request_send(json=payload)
        return r

    def list_table_save_line(self, payload):
        """
        清单表数据保存
        """
        r = self.request_send(json=payload)
        return r

    def list_table_table_page(self, payload):
        """
        获取清单表pov
        """
        r = self.request_send(params=payload)
        return r

    def react_form_list_export(self, payload):
        """
        清单表数据导出
        """
        r = self.request_send(json=payload)
        return r

    def react_form_list_line_param(self, payload):
        """
        获取行上是否允许跳转打开行接口
        """
        r = self.request_send(json=payload)
        return r

    def list_table_permissions_data(self, payload):
        """
        清单表权限数据保存
        """
        r = self.request_send(json=payload)
        return r

    def list_table_permissions_export(self, payload):
        """
        清单表权限数据导出
        """
        r = self.request_send(json=payload)
        return r

    def list_table_permissions_import(self, payload):
        """
        清单表权限数据导入
        """
        r = self.request_send(json=payload)
        return r

    def list_table_permissions_page(self, payload):
        """
        清单表权限数据分页查询
        """
        r = self.request_send(json=payload)
        return r

    def list_table_access_unit_columns(self, payload):
        """
        获取启用权限控制的展示列和pov数据
        """
        r = self.request_send(params=payload)
        return r

    def list_table_access_unit_controls(self, payload):
        """
        获取展示列和pov中的权限控制单元
        """
        r = self.request_send(params=payload)
        return r

    def list_table_right_use(self, payload):
        """
        清单表权限相关接口
        """
        r = self.request_send(params=payload)
        return r

    def list_table_segment(self, payload):
        """
        获取清单表权限
        """
        r = self.request_send(params=payload)
        return r

    def list_table_segment_post(self, payload):
        """
        清单表权限配置保存接口
        """
        r = self.request_send(json=payload)
        return r

    def react_form_list_button_access(self, payload):
        """
        获取受权限控制的按钮
        """
        r = self.request_send(params=payload)
        return r

    def react_form_list_button_unit(self, payload):
        """
        获取按钮中权限控制单元
        """
        r = self.request_send(params=payload)
        return r

    def export_sql(self, payload):
        """
        清单表导出sql文件
        """
        r = self.request_send(params=payload)
        return r

    def get_query_sql(self, payload):
        """
        根据条件获取查询sql
        """
        r = self.request_send(json=payload)
        return r

    def relation_list(self, payload):
        """
        获取清单表引用关系管理
        """
        r = self.request_send(json=payload)
        return r

    def relation_save(self, payload):
        """
        保存清单表引用关系管理
        """
        r = self.request_send(json=payload)
        return r


if __name__ == '__main__':
    from application.general_create import COOKIE, APP_ID, SPACE_ID

    headers = {"cookie": COOKIE, "language": "zh-cn", "app": APP_ID, "space": SPACE_ID}
    table = ListTable(version="1.2", headers=headers)
    r = table.get_query_sql(
        {"elementName": "list_table_ck", "folderId": "0"}).text
    print(r)